package com.sdx.console.contract.backstage.Utils;

public enum provinceValue {

    pro1(1, "北京"),
    pro2(2, "天津"),
    pro3(3, "辽宁"),
    pro4(4, "河北"),
    pro5(5, "河南"),
    pro6(6, "吉林"),
    pro7(7, "黑龙江"),
    pro8(8, "内蒙古"),
    pro9(9, "山东"),
    pro10(10, "山西"),
    pro11(11, "陕西"),
    pro12(12, "甘肃"),
    pro13(13, "宁夏"),
    pro14(14, "青海"),
    pro15(15, "新疆"),
    pro16(16, "上海"),
    pro17(17, "江苏"),
    pro18(18, "浙江"),
    pro19(19, "安徽"),
    pro20(20, "广东"),
    pro21(21, "海南"),
    pro22(22, "广西"),
    pro23(23, "云南"),
    pro24(24, "贵州"),
    pro25(25, "四川"),
    pro26(26, "重庆"),
    pro27(27, "西藏"),
    pro28(28, "香港"),
    pro29(29, "澳门"),
    pro30(30, "福建"),
    pro31(31, "江西"),
    pro32(32, "湖南"),
    pro33(33, "湖北"),
    pro34(34, "台湾"),

    ;

    private Integer code;

    private String value;


    provinceValue(Integer code, String value) {
        this.code = code;
        this.value = value;
    }


//    public static Integer getCode(Integer code) {
//        provinceValue[] imageFormatTypes = values();
//        for (provinceValue imageFormatType : imageFormatTypes) {
//            if (imageFormatType.code().equals(code)) {
//                return imageFormatType.code();
//            }
//        }
//        return null;
//    }
    //根据code获取value
    public static String getValue(Integer code) {
        provinceValue[] imageFormatTypes = values();
        for (provinceValue imageFormatType : imageFormatTypes) {
            if (imageFormatType.code().equals(code)) {
                return imageFormatType.value();
            }
        }
        return null;
    }

    //根据value获取code
    public static Integer getcode(String value) {
        provinceValue[] imageFormatTypes = values();
        for (provinceValue imageFormatType : imageFormatTypes) {
            if (imageFormatType.value().equals(value)) {
                return imageFormatType.code();
            }
        }
        return null;
    }


    public Integer code() {
        return code;
    }

    public String value() {
        return value;
    }

}
